package com.vcredit.creditcat.manager.speedloan;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vcredit.creditcat.api.task.ISpeedloanTaskManager;
import com.vcredit.creditcat.model.ProcessSpecialCust;
import com.vcredit.creditcat.persistence.base.ProcessSpecialCustMapper;
import com.vcredit.creditcat.service.speedloan.SpeedloanTaskService;

@Service(protocol = { "protocol1" }, version = "1.0")
public class SpeedloanTaskManager implements ISpeedloanTaskManager{

	@Autowired
	private SpeedloanTaskService speedloanTaskService;

	
    @Autowired
	private ProcessSpecialCustMapper mapper;
	
	@Override
	public void handleSpeedloan(ProcessSpecialCust processSpecialCust) throws Exception {
		speedloanTaskService.handleSpeedloan(processSpecialCust);
	}

	@Override
	public List<ProcessSpecialCust> find(ProcessSpecialCust processSpecialCust) throws Exception {
		if (processSpecialCust.getSpecialId() != null && processSpecialCust.getSpecialId() > 0) {
			return mapper.findBySpecialIdAndStatus(processSpecialCust);
		}
		return mapper.find(processSpecialCust);
	}

}
